#ifndef __COMPONENT_HPP__
#define __COMPONENT_HPP__

#include "nlohmann/json.hpp"
#include <string>
#include <cfloat>
#include "entt/entt.hpp"
#include "Utils/Utils.h"

namespace PocketSurvival
{
    struct Component
    {
        entt::entity entity;
        virtual ~Component();
        virtual const std::string &getName() const = 0;

        inline virtual void update(float dt);
        inline virtual void load(const nlohmann::json &jsonData);
        inline virtual void save(nlohmann::json &jsonData);
        inline virtual void saveToMsgJson(nlohmann::json &jsonData);
    };

    inline Component::~Component(){}

    inline void Component::update(float dt) {}
    inline void Component::saveToMsgJson(nlohmann::json &jsonData) {}
    inline void Component::load(const nlohmann::json &jsonData) {}
    inline void Component::save(nlohmann::json &jsonData) {}
    
} // namespace PocketSurvival

#endif
